x86/mm: change ASSERTs to BUG_ONs in mem_sharing.c
authorTim Deegan <Tim.Deegan@citrix.com>
Wed, 8 Dec 2010 10:46:31 +0000 (10:46 +0000)
committerTim Deegan <Tim.Deegan@citrix.com>
Wed, 8 Dec 2010 10:46:31 +0000 (10:46 +0000)
These two ASSERTs have important side-effects so make them into BUG_ONs
consistent with the rest of the file.
Bug found by Jui-Hao Chiang <juihaochiang@gmail.com>.

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
xen/arch/x86/mm/mem_sharing.c

index 2c228233ddfeab51ebb1be1b089c1d54456eaa82..10980dd925479d6daad97e72cd80fd039f64ea2a 100644 (file)
@@ -545,7 +545,7 @@ int mem_sharing_nominate_page(struct p2m_domain *p2m,
          * it a few lines above.
          * The mfn needs to revert back to rw type. This should never fail,
          * since no-one knew that the mfn was temporarily sharable */
-        ASSERT(page_make_private(d, page) == 0);
+        BUG_ON(page_make_private(d, page) != 0);
         mem_sharing_hash_destroy(hash_entry);
         mem_sharing_gfn_destroy(gfn_info, 0);
         shr_unlock();
@@ -700,7 +700,7 @@ gfn_found:
     unmap_domain_page(s);
     unmap_domain_page(t);
 
-    ASSERT(set_shared_p2m_entry(p2m, gfn, page_to_mfn(page)) != 0);
+    BUG_ON(set_shared_p2m_entry(p2m, gfn, page_to_mfn(page)) == 0);
     put_page_and_type(old_page);
 
 private_page_found: